package com.li.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.li.pojo.dto.DictDateDto;
import com.li.pojo.dto.DictDatePageDto;
import com.li.pojo.po.DictDate;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 字典数据表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-04-11
 */
public interface DictDateMapper extends BaseMapper<DictDate> {

    List<DictDate> selectByDictType(String dictType);


    List<DictDate> findByPage(DictDatePageDto pageDto);


    List<DictDate> selectByDictLabel(String dictLabel, String dictType);

    @Select("select * from sys_dict_date where dict_code=#{dictCode}")
    DictDate findByDictCode(Integer dictCode);


    void updateDictDate(DictDate dictDate);

    @Update("update sys_dict_date set dict_type=#{NewDictType} where dict_type=#{OldDictType}")
    void updateMore(String OldDictType, String NewDictType);
}
